import request from '@/axios'
import type { ActionForm } from './types'

export const add = (data: ActionForm): Promise<ApiResult> => {
    return request.post({
        url: '/action',
        data
    })
}

export const edit = (id: string, data: ActionForm): Promise<ApiResult> => {
    return request.put({
        url: `/action/${id}`,
        data
    })
}

export const get = (id: string): Promise<ActionForm> => {
    return request.get({
        url: `/action/${id}`
    })
}